package com.atguigu.yygh.cmn.fallback;

import com.atguigu.yygh.cmn.client.DictFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author:hx
 * @DateTime:2022/11/16 8:08
 * @Description:
 */
@Component
public class DictFeignFallback implements FallbackFactory<DictFeignClient> {
    @Override
    public DictFeignClient create(Throwable throwable) {
        return new DictFeignClient() {
            @Override
            public String getName(String parentDictCode, Long value) {
                return "服务器繁忙,请稍后再试!";
            }

            @Override
            public String getName(Long value) {
                return "服务器繁忙,请稍后再试!";
            }
        };
    }
}
